package com.apes.fn.scm.crossCompany.transfer.model;

import com.apes.framework.jpa.DefaultPersistListener;
import com.apes.framework.jpa.Model;
import com.apes.framework.jpa.comment.Comment;
import com.apes.framework.jpa.generator.ApesGenerator;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SelectBeforeUpdate;

import javax.persistence.*;

/**
 * @BelongsProject: apes-server
 * @BelongsPackage: com.apes.fn.scm.crossCompany.transfer.model
 * @Author: ljp
 * @CreateTime: 2021-07-23 14:01
 * @Description: 单据打印记录
 */
@Getter
@Setter
@SelectBeforeUpdate
@DynamicInsert
@DynamicUpdate
@Entity
@EntityListeners(DefaultPersistListener.class)
@Table(name = PrintRecord.CONST_TABLE_NAME)
public class PrintRecord extends Model {
    public static final String CONST_TABLE_NAME = "print_record";
    @Id
    @Column(name = "id",nullable = false,length = 64)
    @Comment("编码")
    @ApesGenerator(code = CONST_TABLE_NAME, name = "打印记录表", padding = 8)
    private String id;

    @Column(name = "source", length = 30,unique = true)
    @Comment("来源单据")
    private String source;//单号唯一

    @Column(name = "source_business_type", length = 32)
    @Comment("来源单据类型")
    private String sourceBusinessType;

    @Column(name = "source_business_type_name", length = 64)
    @Comment("来源单据类型名称")
    private String sourceBusinessTypeName;

    @Column(name = "print_number", columnDefinition = "number(4,0) default 0")
    @Comment("打印次数")
    private double printNumber;
}
